
//player functions
function loadYoutubeMovie(youtubeUrl) {

	var params = { allowScriptAccess: "always" };

	var atts = { id: "youtubeplayer"};

	swfobject.embedSWF(youtubeUrl + "&enablejsapi=1&playerapiid=youtubeplayer", "player-div", "560", "340", "8", null, null, params, atts);
}

function onYouTubePlayerReady(playerId) {

	getYoutubePlayer().addEventListener("onStateChange", "onYoutubePlayerStateChange");
}

function getYoutubePlayer() {

	return document.getElementById("youtubeplayer");
}

function playVideo() {
	getYoutubePlayer().playVideo();
}

function pauseVideo() {
	getYoutubePlayer().pauseVideo();
}


function getCurrentTime() {

	return getYoutubePlayer().getCurrentTime();
}

function seekTo(seconds) {

	getYoutubePlayer().seekTo(seconds, true);
}



